#ifndef _DATABASE_H_
#define _DATABASE_H_
#include "Player.h"
#include "Result.h"
#include <mysql.h>

enum DataBaseType
{
	WorldDatabase,LoginDataBase,CharacterDatabase,
};
class Database
{
public:
	Database();
	~Database();
	//static
	static Database* GetInstance();
	Result::Qurey GetResult(DataBaseType type, const char* format, ...);
	Result::Qurey GetResult(DataBaseType type, char* args);
	void PExcude(DataBaseType type, const char* args, ...);
	bool ConnectDatabaes();
	void StartDataBaseHoding(int diff);
	void GetUpdate();
	//Result::Qurey GetResult(char* args);
	void LoadPlayerFromDB();
	void LoadCardTemplate();
	void LoadSpellTemplate();
private:
	unsigned int Databasestarttime;
	int DataBaseHodingTimer;
	std::string server;
	std::string user;
	std::string password;
	std::string database;
	int port;
};




#endif